﻿#region License

/*
    Copyright (c) 2012 Joseph Haluska
    This source is subject to the Microsoft Public License (Ms-PL).
    Please see http://www.microsoft.com/en-us/openness/licenses.aspx for details.
    All other rights reserved.
*/

#endregion License

using System;
using System.Windows.Forms;
using NetExceptionReporter.Utilities;

namespace NetExceptionReporter
{
    internal static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        private static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            if (args.Length > 0)
            {
                try
                {
                    ExceptionWindowData data = (ExceptionWindowData)SerializationUtilities.FromBase64(args[0]);

                    if (data != null)
                        Application.Run(new ExceptionReporterForm(data));
                }
                catch { }
            }

            //else
            //    Application.Run(new ExceptionReporterForm());
        }
    }
}